home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / OBJ1_2.ZIP;1 / C_REPORT.TXT < prev    next >
Encoding:
Text File  |  1993-01-21  |  4.9 KB  |  130 lines

  1. '
  2. 'Class description:
  3. '
  4. !short:Report class structure:
  5. Classn Report:
  6. ~~~~~~~~~~~~~~
  7. This class is used for report creation.
  8.  
  9. Common use:
  10. ~~~~~~~~~~~
  11. LOCAL OBJECT Rep OF Report  //new object created
  12. Rep:Init(...)               //initialised
  13. Rep:AddTop(...)             //report header appended
  14. Rep:AddField(...)           //repeatedly appended the report columns
  15. ...                         //...definitions
  16. Rep:AddBottom(...)          //bottom line appended
  17.  
  18. This object initialisation adds this object as task to the task stack
  19. and the task swapper does the activating and finishing of this object.
  20.  
  21. Source code is in C_Report.prg
  22.  
  23. !seealso: c_finfo.ngo:FInfo c_info.ngo:Info c_view.ngo:View c_color.ngo:Color ob_class.ngo:"Class hierarchy"
  24.  
  25. !short:~~~~~~~~~~~~~~~~~~~~~~~
  26. !short:create class Report from DBrowse
  27. !short:  export:
  28. !short:  var FName      //""
  29. ^BReport:FName^N: read-only: character
  30.   Report file name.
  31.  
  32. !short:  var Handle     //-1
  33. ^BReport:Handle^N: private: numeric
  34.   Access variable to file FName.
  35.  
  36. !short:  var Width      //0
  37. ^BReport:Width^N: private: numeric
  38.   Report width in number of characters (columns)
  39.  
  40. !short:  var TopText    //""
  41. ^BReport:Top^N: read-only: character
  42.   Report header, the lines can be separated by semicolon (;)
  43.  
  44. !short:  var Fields     //{}
  45. ^BReport:Fields^N: read-only: array
  46.   The columns definition in form of:
  47.   Fields:={}
  48.   AAdd( Field, {cTitle,cField,cPicture,lTotal,cSubTotal} )
  49.   ...
  50.   Where:
  51.   cTitle    - is column heading
  52.   cField    - is a full name of database field (alias->field).
  53.   cPicture  - is a picture mask definition for this field
  54.   lTotal    - is true if the field should be totaled
  55.   cSubTotal - is the database filed name after which we shall total or ""
  56.  
  57. !short:  var FSizes     //{}
  58. ^BReport:FSizes^N: read-only: array
  59.   Report file column sizes.
  60.  
  61. !short:  var Totals     //{}
  62. ^BReport:Totals^N: read-only: array
  63.   Report file column totals.
  64.  
  65. !short:  var BottomText //""
  66. ^BReport:BottomText^N: read-only: character
  67.   Bottom text of the report, the rows are separated with semicolon (;).
  68.  
  69. !short:  var OldOrder   //0
  70. ^BReport:OldOrder^N: private: numeric
  71.   When creating the report can be a new index file activated, so the last
  72.   opened index file number is stored here to restore the indexes after the
  73.   report is created or when switching to other task.
  74.  
  75. !short:  var OnlyTotals //false
  76. ^BReport:OnlyTotals^N: public: logical
  77.   Default is false, i.e. standart report creation; if you set it to true,
  78.   then will be output only subtotals and totals.
  79.  
  80. !short:  method New=ReportNew            //o:New() --> self
  81. ^BReport:New()^N: public: return self
  82.   Object is filled with default values. The following predcessor variables
  83.   are modified:
  84.  
  85.   ^UReport:InfoBlock^N: public: code_block: override
  86.     The code block for writing the processed record number of selected
  87.     database to the bottom window  border is stored here.
  88.  
  89.   ^UReport:DoneBlock^N: public: code_block: override
  90.     If the user inerrupts the report creation, the output file and the
  91.     temporary index file must be closed and deleted.
  92.  
  93. !short:  method Init=ReportInit          //o:Init(Name,R,C,Rs,Cs,Clr,Shd) --> true
  94. ^BReport:Init(Name,R,C,Rs,Cs,Clr,Shadow)^N: public: return true
  95.   The object is initialised with the same parameters as the predcessor
  96.   method Init() of class Box.
  97.  
  98. !short:  method AddData=ReportAddData    //o:AddData(cTop,aFields,cBottom,lnlyTotals) --> true
  99. ^BReport:AddData(cTop,aFields,cBottom,lOnlyTotals)^N: public: return true
  100.   The instvar variables Top, Fields, Bottom and OnlyTotals of this object
  101.   can be directly modified. The parameter values are directly assigned to
  102.   instvar variables of the object.
  103.  
  104. !short:  method AddTop=ReportAddTop      //o:AddTop(cTop) --> true
  105. ^BReport:AddTop(cTop)^N: public: return true
  106.   The parameter cTop is copied to instvar variable Top of this object.
  107.  
  108. !short:  method AddField=ReportAddField  //o:AddField(cTitle,cField,cPic,lTot,cSubT) --> true
  109. ^BReport:AddField(cTitle,cField,cPicture,lTotal,cSubTotal)^N:
  110.   public: return true
  111.   The instvar variable Fields of this object is created, the repeated
  112.   calling of this method fills the value of its parameters to this variable.
  113.   See the structure and meaning of instvar variable Fields.
  114.  
  115. !short:  method AddBottom=ReportAddBottom//o:AddBottom(cBottom) --> true
  116. ^BReport:AddBottom(cBottom)^N: return true
  117.   The cBottom parameter is copied to instvar variable Bottom of this object.
  118.  
  119. !short:  method VPaint=ReportVPaint      //o:VPaint() --> true
  120. ^BReport:VPaint()^N: private: return true
  121.   The paint method for displaying this class of objects.
  122.  
  123. !short:  method VProcess=ReportVProcess  //o:VProcess() --> true
  124. ^BReport:VProcess();^N: private: return true
  125.   This method creates the report, after that destroys itself and creates the
  126.   child process to view the created report.
  127.  
  128. !short:  endclass
  129.  
  130.